How to compile E2FS Library

If you are under Linux, you should already have e2fsprogs, get the devel package if you don't have it. Otherwise, get e2fsprogs-1.26.tgz or a new version at http://e2fsprogs.sourceforge.net.

Packages for DJGPP

I don't know if you need them all but it works for me.

Patching DJGPP

In include/signal.h, add

#ifndef SIGCONT
#define SIGCONT	18	/* CG */
#endif
In include/mntent.h, add
#ifndef MOUNTED
#define	MOUNTED	"/etc/mtab"	/* CG */
#endif
#ifndef MNTOPT_RO
#define	MNTOPT_RO "ro"	/* CG */
#endif
In include/errno.h, add
#ifndef EOPNOTSUPP
#define EOPNOTSUPP 95	/* CG */
#endif

Patching EXT2FS for BSD or DJGPP

In lib/uuid/gen_uuid.c, comment the following line

//#include 	/* CG */
If you are under BSD, in lib/ext2fs/flushb.c, add
#include <sys/param.h>

Compilation

Under Dos or Win9x, run

bash
./configure --with-cc=gcc && make libs
Under Linux or BSD, run ./configure && make

ReiserFS Library

bash
./configure --disable-nls
make

I can't compile this library under FreeBSD 4.3. It compiles with DJGPP under Dos but it doesn't work.

Binary distribution

To reduce the e2fs library size, run strip -g libext2fs.a.


TestDisk home: http://www.cgsecurity.org/testdisk.html.
Christophe GRENIER grenier@cgsecurity.org